{% extends 'layout.html' %}

{%block main%}
<ol class="breadcrumb">
    <li><a href="/">首页</a></li>
    <li><span>用户列表</span></li>
</ol>
<h3>用户列表</h3>
<table class="table table-hover table-bordered">
    <tr>
        <td>ID</td>
        <td>用户名</td>
        <td>密码</td>
        <td>是否是管理员</td>
        <td>设为管理员</td>
        <td>删除用户</td>
    </tr>
    {%for user in users%}
    <tr>
        <td>{{user._id.toString()}}</td>
        <td>{{user.username}}</td>
        <td>{{user.password}}</td>
        <td>{%if user.isAdmin%}是{%else%}否{%endif%}</td>
        <td>
            <a href="/admin/user/setAdmin?id={{user._id.toString()}}">是</a>/
            <a href="/admin/user/removeAdmin?id={{user._id.toString()}}">否</a>
        </td>
        <td>
            <a href="/admin/user/userRemove?id={{user._id.toString()}}">删除</a>
        </td>
    </tr>
    {%endfor%}
</table>
{%include 'page.html'%}
{%endblock%}